Object.defineProperty(exports, "__esModule", { value: !0 }),
  (exports.calculateStringLength = function (e) {
    for (var t = 0, r = 0; r < e.length; r++) {
      var n = e.charAt(r);
      /[\u4e00-\u9fa5]/.test(n) ? (t += 2) : (t += 1);
    }
    return t;
  }),
  (exports.deepClone = function e(r) {
    if (!r || "object" !== t(r)) return r;
    var n = r instanceof Array ? [] : {};
    return (
      r.forEach(function (o, a) {
        r.hasOwnProperty(a) && (n[a] = "object" === t(r[a]) ? e(r[a]) : r[a]);
      }),
      n
    );
  }),
  (exports.format = function (e) {
    var t = Number(e) ? Number(e) : 0;
    t < 0 && (t = 0);
    return ""
      .concat(
        "0".repeat(2 - String(Math.floor(t / 60)).length) + Math.floor(t / 60),
        ":",
      )
      .concat("0".repeat(2 - String(Math.floor(t % 60)).length))
      .concat(Math.floor(t % 60));
  }),
  (exports.getHttpParamByKey = exports.formatted = void 0),
  (exports.getKeyword = function (t, r) {
    var n,
      o = t.replace(r, "".concat("--").concat(r).concat("--")).split("--"),
      a = [],
      i = e(o);
    try {
      for (i.s(); !(n = i.n()).done; ) {
        var c = n.value;
        a.push({ text: c, keyword: c === r });
      }
    } catch (e) {
      i.e(e);
    } finally {
      i.f();
    }
    return a;
  }),
  (exports.getShowDistance = function (e) {
    var t = "0米";
    if (!e || e <= 0) return (t = "");
    e < 1e3
      ? (t = "".concat(parseInt(e), "米"))
      : e >= 1e3 && e < 1e4
        ? (t = (t = "".concat((e / 1e3).toFixed(1), "公里")).replace(".0", ""))
        : e >= 1e4 && (t = "".concat(parseInt(e / 1e3), "公里"));
    return t;
  }),
  (exports.getUid = exports.getTime = void 0);
var e = require("../@babel/runtime/helpers/createForOfIteratorHelper"),
  t = require("../@babel/runtime/helpers/typeof");
exports.formatted = function (e) {
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "";
  if (!e) return "";
  var r = e.split("");
  return (
    r.splice(4, 0, t || "年"),
    r.splice(7, 0, t || "月"),
    r.splice(10, 0, t ? "" : "日"),
    r.join("")
  );
};
exports.getUid = function () {
  var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 32,
    t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
    r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null,
    n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(
      "",
    ),
    o = [],
    a = r || n.length;
  if (e) for (var i = 0; i < e; i++) o[i] = n[0 | (Math.random() * a)];
  else {
    var c;
    (o[8] = "-"), (o[13] = "-"), (o[18] = "-"), (o[23] = "-"), (o[14] = "4");
    for (var l = 0; l < 36; l++)
      o[l] ||
        ((c = 0 | (16 * Math.random())),
        (o[l] = n[19 === l ? (3 & c) | 8 : c]));
  }
  return t ? (o.shift(), "u".concat(o.join(""))) : o.join("");
};
(exports.getTime = function (e) {
  if (!e) return "";
  var t = new Date(),
    r = t.getFullYear(),
    n = t.getMonth() + 1,
    o = t.getDate(),
    a = new Date(t.getTime() + 864e5),
    i = a.getFullYear(),
    c = a.getMonth() + 1,
    l = a.getDate(),
    p = new Date(e),
    u = p.getFullYear(),
    s = p.getMonth() + 1,
    f = p.getDate();
  return r === u && n === s && o === f
    ? "当日"
    : i === u && c === s && l === f
      ? "明日"
      : "".concat(e.split("-")[1], "月").concat(e.split("-")[2], "日");
}),
  (exports.getHttpParamByKey = function (e, t) {
    for (
      var r = {}, n = decodeURIComponent(e).split("?")[1].split("&"), o = 0;
      o < n.length;
      o++
    ) {
      var a = n[o].split("=");
      r[a[0]] = a[1];
    }
    return r[t] || "";
  });
